<%@page language="java" pageEncoding="UTF-8"%>
<%@include file="/views/common/include/taglib.jsp"%>
<link type="text/css" rel="stylesheet"
	href="${ctx }/css/dlifestyle/sectionparent.css" source="widget" />
<link type="text/css" rel="stylesheet"
	href="${ctx }/css/dlifestyle/admin.css" source="widget" />
<script
	src="${ctx}/js/controllers/base/appconfig/AppConfigEditController.js"
	type="text/javascript"></script>
<style>
select {
	padding-left: 18px;
	font-size: 10px;
	border-radius: 10px;
	background-image: none;
	border: 1px solid #E5E5E5;
	color: #8b8787;
}
</style>
<section>
	<div style="height: 40px; line-height: 40px;">
		<div class="forword_area"></div>
		<div class="location">当前位置：${sessionScope.currcent_position}</div>
	</div>
	<div class="panel panel-default">
		<div class="editTitle">
			<div style="height: 41px; width: 190px; float: left;">
				<img style="float: left; margin-left: 37px; margin-top: 9.5px;"
					src="${ctx}/images/new_edit.png" />
				<c:if test="${type == 1 }">
					<h4>新增图标</h4>
				</c:if>
				<c:if test="${type == 2 }">
					<h4>编辑图标</h4>
				</c:if>
			</div>
			<div>
				<a style="float: right; margin-right: 20px; margin-top: -2px;"
					title="关闭" onclick="cancel();"><img
					src="${ctx}/images/new_close.png" /></a>
			</div>
		</div>

		<div class="form">
			<div class="itemEditMap" style="height: 100px">
				<input id="appConfigId" type="hidden" value="${appConfig.id }">
				<input id="imageLogo" type="hidden" value="${appConfig.imgUrl }">
				<span class="col-sm-1 editlableEditMap"
					style="height: 100px; line-height: 100px;">图像：</span>
				<div class="flEditMap" style="height: 100px;">
					<c:if test="${appConfig.imgUrl == null || appConfig.imgUrl == ''}">
						<img id="preview3"
							style="width: 70px; height: 70px; float: left; margin-top: 10px;"
							title="快上传APP头像吧" src="${ctx}/images/config-default.png" />
					</c:if>
					<c:if test="${appConfig.imgUrl != null && appConfig.imgUrl != ''}">
						<img id="preview3"
							style="width: 70px; height: 70px; float: left; margin-top: 10px;"
							src="${sessionScope.image_logo}${appConfig.imgUrl}" />
					</c:if>
					<div class="mtjxsa" style="float: left; margin: 25px 20px;">
						<p style="text-align: left; font-size: 12px;" id="imageBtn">
							<input type="hidden" name="imageLogoUrl" id="imageLogoUrl"
								value="${appConfig.imgUrl}" /> <label class="lbl"
								style="width: 400px; height: 15px;">提示：只能上传.jpg,.png的图片格式,照片文件大小最大为10MB</label>
						</p>
						<div>
							<div class="fl">
								<button
									style="width: 100px; height: 25px; margin-top: 5px; background-color: #593505; color: #fff; border: 0px; line-height: 25px;"
									class="acblu tctpsc">上传头像</button>
							</div>
						</div>
					</div>
					<%@include file="/views/common/uploader/picture.jsp"%>
				</div>
			</div>
			<div class="itemEdit">
				<span class="col-sm-1 editlableEdit">图标名称：</span>
				<div class="flEdit">
					<input class="controlEdit" style="width:80%" id="imgName" onblur="checkImgName();"
						value="${appConfig.imgName }" type="text" class="text"
						maxlength="50" placeholder="请输入名称（最多50字）" /> <em class="emStyle">*</em>
				</div>
			</div>
			<div class="itemEdit">
				<span class="col-sm-1 editlableEdit">排序：</span>
				<div class="flEdit">
					<input class="sortEdit" onblur="checkSort()" id="sort"
						type="number" maxlength="11"
						value="${appConfig.sort == null ? 1 : appConfig.sort}"> <em
						class="emStyle">*</em>
				</div>
			</div>
			<div class="itemEdit">
				<span class="col-sm-1 editlableEdit">商品分类：</span>
				<div class="flEdit">
					<select id="cateType" class="editform-control" onblur="checkCateType();"
						style="height: 30px; width: 140px;">
						<c:forEach items="${shopCates}" var="item">
						<option value="${item.id}"
							<c:if test="${appConfig.shopCategoryId == item.id}">selected="selected"</c:if>>${item.name}</option>
						</c:forEach>
					</select>
				</div>
			</div>
			<div class="itemEdit">
				<span class="col-sm-1 editlableEdit">图标类型：</span>
				<div class="flEdit">
					<select id="objType" class="editform-control" onblur="checkObjType();"
						style="height: 30px; width: 140px;">
						<option value="-1"
							<c:if test="${appConfig.objType == -1 }">selected="selected"</c:if>>&nbsp;&nbsp;&nbsp;图标类型</option>
						<option value="0"
							<c:if test="${appConfig.objType == 0 }">selected="selected"</c:if>>&nbsp;&nbsp;&nbsp;首页图标</option>
						<option value="1"
							<c:if test="${appConfig.objType == 1 }">selected="selected"</c:if>>&nbsp;&nbsp;&nbsp;商城图标</option>
					</select>
				</div>
			</div>
		</div>

		<div class="foot">
			<button class="buttonCancle" onclick="cancel();">取&nbsp;&nbsp;消</button>
			<button class="buttonEdit" onclick="saveAppConfig();">保&nbsp;&nbsp;存</button>
		</div>
	</div>
	<%@include file="/views/common/footer.jsp"%>
</section>
<script type="text/javascript">
	var ctx = '${ctx}';
	setCtx(ctx);
</script>
<!-- 解决ie 6 7 8 9不能显示placeholder的问题 -->
<script src="${ctx}/js/lib/jquery.JPlaceholder.js"></script>
